package src;

public class Variation {

	public String word = null;
	public String token;//smsToken
	int match = 0;
	double editDistance = 0;
	public double weight ;
	int varBitIndex = 0;
	String englishWord = null;
	//public float probability = 1;
	//public Float idf = null;
	
	public Variation(String smsToken, String variation,String HindiWord, 
			int subSequenceLength, int dist, Float f){
		token = smsToken;
		word = HindiWord;
		englishWord = variation;
		//probability = prob;
		match = subSequenceLength;
		editDistance = dist; //changes
		if(dist == 0){
			editDistance = (float)0.5;
		}
		double lcsRatio = (double)match/(double)englishWord.length();//Math.sqrt((double)a.length());
		if(f == null){
			weight = 0;
		}
		else{
			weight = (lcsRatio)*f.floatValue()/editDistance;
		}
	}

	
	public Variation(String smsToken, String variation, 
			int subSequenceLength, int dist, Float f){
		token = smsToken;
		word = variation;
		//probability = prob;
		match = subSequenceLength;
		editDistance = dist; //changes
		if(dist == 0){
			editDistance = (float)0.5;
		}
		double lcsRatio = (double)match/(double)variation.length();//Math.sqrt((double)a.length());
		if(f == null){
			weight = 0;
		}
		else{
			weight = (lcsRatio)*f.floatValue()/editDistance;
		}
	}

	
	public void setWeight(double wt){
		weight = wt;
	}
	
	public void setVarBitIndex(int i){
		varBitIndex = i;
	}
	
	public void setWeightWithProbability(double prob){
		weight = weight * prob;
	}
}
